<?php
/*
 * @Date: 2025-08-02 02:05:31
 * @LastEditors: 贾二小 erxiao.jia@outlook.com
 * @LastEditTime: 2025-08-09 01:21:11
 * @FilePath: /admin-api/database/migrations/2025_08_01_180531_create_menus_table.php
 */

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('menus', function (Blueprint $table) {
            $table->id();
            $table->integer('parent_id')->comment('父菜单ID');
            $table->string('label')->comment('名称');
            $table->string('icon')->nullable()->comment('图标');
            $table->string('router_name')->nullable()->comment('路由名称');
            $table->boolean('status')->default(true)->comment('状态');
            $table->integer('order')->default(1)->comment('排序');
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('menus');
    }
};
